package com.example.dou2204.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.dou2204.R;
import com.example.dou2204.entity.BannerEntity;
import com.example.dou2204.entity.CommentEntity;

import java.util.List;

public class CommentAdapter extends BaseQuickAdapter<CommentEntity.DataBean, BaseViewHolder> {
    public CommentAdapter(int layoutResId, @Nullable List<CommentEntity.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder holder, CommentEntity.DataBean bean) {
        ImageView iv = holder.findView(R.id.iv_user);
        Glide.with(getContext()).load(bean.getIcon()).into(iv);
        holder.setText(R.id.tv_user,bean.getUsername());
        holder.setText(R.id.tv_msg,bean.getMsg());
        holder.setText(R.id.tv_time, bean.getCreatetime());
    }
}
